pkgname=firmware-huawei-g7
pkgver=1
pkgrel=1
pkgdesc="Firmware for Huawei Ascend G7"
url="https://postmarketos.org"
subpackages="$pkgname-wcnss-nv:wcnss_nv"
arch="aarch64"
license="proprietary"
options="!check !strip !archcheck !tracedeps pmb:cross-native"
source="$pkgname-WCNSS_qcom_wlan_nv.bin.base64::https://pastebin.com/raw/UmTSZBW7"

_fwdir="/lib/firmware/postmarketos"

build() {
	base64 -d $pkgname-WCNSS_qcom_wlan_nv.bin.base64 > WCNSS_qcom_wlan_nv.bin
}

package() {
	# parent package is empty
	mkdir -p "$pkgdir"
}

wcnss_nv() {
	pkgdesc="Huawei Ascend G7 WiFi/BT firmware configuration"
	install -Dm644 "$srcdir"/WCNSS_qcom_wlan_nv.bin -t "$subpkgdir/$_fwdir"/wlan/prima
}

sha512sums="0202ce7d2f736a6a2d37ab571233d715376184c647ba916d9e3e9aaf1408f1aa41f877d6f805d274ead1440dabf295e7477da6957555604cee90ecd5a9a3a24b  firmware-huawei-g7-WCNSS_qcom_wlan_nv.bin.base64"
